home *** CD-ROM | disk | FTP | other *** search
/ User's Choice Windows CD / User's Choice Windows CD (CMS Software)(1993).iso / win_e_h / fc_20e.zip / WWWMENUS.DL_ < prev    next >
Text File  |  1992-09-20  |  31KB  |  800 lines

  1. ; WWWMENUS.DLL
  2. ; Common menus used by WWW Products
  3.  
  4.     CancelCmd="Exit"
  5.     goto %param1%        ; Go immediately to desired section
  6.                          ; Defined sections are:
  7.                               ZIP
  8.                               UNZIP
  9.                               SYSINFO
  10.                               INIEDIT
  11.                               FONEBOOK
  12.                               DIRSIZE
  13.                               FILEINFO
  14.                               FREESPACE
  15.                               CMDSTACK
  16.                               PROGBUILD
  17.                               WALLPAPER
  18. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  19. :WALLPAPER
  20.            a=strcat(CurrentPath(),CurrentFile()) ; Is a BMP file hilited?
  21.            if FileExtension(a)=="BMP" then goto doit
  22.            a=FileItemize("*.bmp")                ; No?  Any in Current Directory?
  23.            if a!="" then goto sel
  24.  
  25.            ; Hmmm cannot find any BMP in current dir.  Check INI/Prompt user for info
  26.            WallDir1=inireadpvt("wallpaper","WallPaperDir","ASK","WWW-PROD.INI")
  27.            :REASK
  28.            if WallDir1=="ASK" then WallDir=AskLine("WallPaper","What directory are your *.BMP WallPaper files in?",DirWindows(0))
  29.                               else WallDir=WallDir1
  30.            ErrorMode(@off)
  31.            DirChange(WallDir)
  32.            ErrorMode(@cancel)
  33.            a=FileItemize("*.BMP")
  34.            if a=="" then Message("WallPaper Error","No *.BMP files found in %WallDir%")
  35.                     then goto REASK
  36.            if WallDir!=WallDir1 then iniwritepvt("wallpaper","WallPaperDir",WallDir,"WWW-PROD.INI")
  37.  
  38.            :sel
  39.            a=strcat("-None- ",a)
  40.            a=ItemSelect("Select New Wallpaper",a," ")
  41.            terminate(a=="","Wallpaper","No wallpaper selected")
  42.            if a=="-None-" then Wallpaper("",0)
  43.                           then exit
  44.            a=strcat(DirGet(),a)
  45.            :doit
  46.            tile=@FALSE
  47.            if FileSize(a)<40000 then tile=@TRUE
  48.            ;if bmp size less than 40K, assume tile, else center
  49.            Wallpaper(a,tile)
  50.            drop(a,b,tile)
  51.            Exit
  52. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  53. :PROGBUILD
  54.     ;Uses DDE to get ProgMan to divluge contents of groups and builds
  55.     ;CmdPost and File Commander menu items to match
  56.  
  57.     CancelCmd="goto cancelbuild"
  58.  
  59.     OldWinTitle=WinName()
  60.     WinTitle("","Prog Build Initializing")
  61.     f=0
  62.     Pause("Progman Capture","This menu item will rebuild this menu file%cr%with the current contents of ProgMan groups.%cr%It does take a few minutes, so be patient.")
  63.     ProgWho=""
  64.     If stricmp("FileCmdr",param2)==0 then ProgWho="FC"
  65.                                      then OldWinTitle="File Manager"
  66.     If stricmp("CmdPost",param2)==0  then ProgWho="CP"
  67.     Terminate(ProgWho=="","ProgBuild Menu Error","Param2 not CP or FC")
  68.  
  69.     LSP=""
  70.     if ProgWho=="CP" then newcpm = "cmdgroup.cpm"
  71.                      then LSP=" "
  72.     if ProgWho=="FC" then newcpm = "wwwfc4.mnu"
  73.     n=FileLocate(newcpm)
  74.     if n=="" then newcpm=strcat(DirWindows(0),newcpm)
  75.              else newcpm=n
  76.  
  77.     startpm = 0
  78.     channel = DDEInitiate("Progman", "Progman")
  79.     If channel != 0 Then Goto DDEOK
  80.     ; Hmmm DDE not working.  Check for Progman
  81.     If WinExist("Program Manager") then Goto TRY2
  82.     startpm = 1
  83.     If !FileExist("progman.exe") then Message("ProgMan Capture","Cannot find PROGMAN.EXE")
  84.                                  then goto cancelbuild
  85.     RunHide("progman.exe", "")
  86.   :TRY2
  87.     channel = DDEInitiate("Progman", "Progman")
  88.     If channel == 0 Then Goto ddeerror
  89.   :DDEOK
  90.     groups = DDERequest(channel, "Groups")
  91.     If groups == "***NACK***" Then Goto ddeerror
  92.     groups = StrReplace(groups, cr, tab)
  93.     groups = ItemSort(groups, tab)
  94.     f = FileOpen(newcpm, "WRITE")
  95.     if ProgWho=="CP" then FileWrite(f,"&Groups")
  96.                      then FileWrite(f," Rebuild Menu from ProgMan Grps")
  97.                      then FileWrite(f,'        Call("wwwmenus.dll","PROGBUILD %%IniSection%%")')
  98.     if ProgWho=="FC" then FileWrite(f,"Rebuild Menu from ProgMan Grps")
  99.                      then FileWrite(f,'        Call("wwwmenus.dll","PROGBUILD %%IniSection%%")')
  100.     n = ItemCount(groups, tab)
  101.     i = 0
  102.   :nextgroup
  103.     i = i + 1
  104.     group = ItemExtract(i, groups, tab)
  105.     If group == "" Then Goto error
  106.  
  107.     if i==1 then FileWrite(f, strcat(LSP,"_",group))
  108.             else FileWrite(f, strcat(LSP,group))
  109.  
  110.     items = DDERequest(channel, group)
  111.     If items == "***NACK***" Then Goto ddeerror
  112.     items = StrReplace(items, cr, tab)
  113.     items = ItemRemove(1, items, tab)
  114.     items = ItemSort(items, tab)
  115.  
  116.     o = ItemCount(items, tab)
  117.     j = 0
  118.   :nextitem
  119.     j = j + 1
  120.     item = ItemExtract(j, items, tab)
  121.     If item == "" Then Goto error
  122.  
  123.     itemdesc = ItemExtract(1, item, ",")
  124.     itemdesc = StrSub(itemdesc, 2, StrLen(itemdesc) - 2)
  125.  
  126.     itemprog = StrLower(ItemExtract(2, item, ","))
  127.     itemprog = StrSub(itemprog, 2, StrLen(itemprog) - 2)
  128.     WinTitle("",`<Group %group% %i%/%n% : Item %itemprog% %j%/%o%>`)
  129.     itemparms = ""
  130.     sp1 = StrIndex(itemprog, " ", 1, @FWDSCAN)
  131.     If sp1 == 0 Then Goto noparms
  132.     itemparms = StrSub(itemprog, sp1 + 1, StrLen(itemprog) - sp1)
  133.     itemprog = StrSub(itemprog, 1, sp1 - 1)
  134.     :noparms
  135.  
  136.     itemdir = StrLower(ItemExtract(3, item, ","))
  137.  
  138.     ; Do HotKeys for CmdPost
  139.     hotkey = ""
  140.     if ProgWho!="CP" then goto nohotkey
  141.     itemkey = ItemExtract(8, item, ",")
  142.     If itemkey == "0" Then Goto nohotkey
  143.     hotkey = " \ "
  144.     If itemkey & 1024 Then hotkey = StrCat(hotkey, "!")
  145.     If itemkey & 512 Then hotkey = StrCat(hotkey, "^")
  146.     If itemkey & 256 Then hotkey = StrCat(hotkey, "+")
  147.     hotkey = StrCat(hotkey, Num2Char(itemkey & 255))
  148.     :nohotkey
  149.  
  150.     icon = ""
  151.     If ItemExtract(9, item, ",") == "1" Then icon = "Icon"
  152.  
  153.     FileWrite(f, `%LSP% %itemdesc%%hotkey%`)
  154.     If itemdir != "" Then FileWrite(f, `       DirChange("%itemdir%")`)
  155.     FileWrite(f, `       Run%icon%("%itemprog%", "%itemparms%")`)
  156.     FileWrite(f, ``)
  157.  
  158.     If j < o Then Goto nextitem
  159.     If i < n Then Goto nextgroup
  160.     Goto pbdone
  161.  
  162.     :error
  163.     Message("ProgMan Group Capture Error", "Operation unsuccessful")
  164.     Goto cancelbuild
  165.  
  166.     :ddeerror
  167.     Message("ProgMan Group Capture DDE Error", "Operation unsuccessful")
  168.     Goto cancelbuild
  169.  
  170.     :pbdone
  171.     Message("ProgMan Group Capture", "Processing complete%cr%Push OK and wait for menu reload.")
  172.  
  173.     :cancelbuild
  174.     if f!=0 then FileClose(f)
  175.     If IsDefined(channel) Then DDETerminate(channel)
  176.     If startpm == 1 Then WinClose("Program Manager")
  177.     WinTitle("",OldWinTitle)
  178.     Drop(newcpm, startpm, channel, f, i, j, n, o, groups, group, items, item)
  179.     Drop(itemdesc, itemprog, itemparms, itemdir, itemkey, hotkey, icon, sp1)
  180.     Drop(OldWinTitle)
  181.     Reload()
  182.     Exit
  183. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  184. :CMDSTACK
  185.         ; CmdStack uses wierd variable names to reduce the chance that a user
  186.         ; will try to execute a statement using the same names!!
  187.         if !IsDefined(CMDSTK987Cmds) Then CMDSTK987Cmds=""
  188.         if !IsDefined(CMDSTK987Last) Then CMDSTK987Last="1+2+3"
  189.         goto %param2%
  190.  
  191.    :PREVIOUS
  192.         If CMDSTK987Cmds == "" Then Goto NEWCMD
  193.         CMDSTK987Now = TextSelect("Select a command, or OK to enter a new command", CMDSTK987Cmds, tab)
  194.         If CMDSTK987Now != "" Then Goto DOIT
  195.    :NEWCMD
  196.         CMDSTK987Now = AskLine("WIL Interactive", "Command to execute:", CMDSTK987Last)
  197.         If CMDSTK987Now == "" Then Goto PREVIOUS
  198.    :DOIT
  199.         Execute Message(CMDSTK987Now, %CMDSTK987Now%)
  200.         if ItemLocate(CMDSTK987Now,CMDSTK987Cmds,tab) then goto PREVIOUS
  201.         a=tab
  202.         if CMDSTK987Cmds=="" then a=""
  203.         CMDSTK987Cmds = StrCat(CMDSTK987Cmds, a, CMDSTK987Now)
  204.         CMDSTK987Last = CMDSTK987Now
  205.         Goto PREVIOUS
  206.  
  207.    :FLUSH
  208.       If AskYesNo("Flush WIL command stack", "Really?") Then CMDSTK987Cmds = ""
  209.       Exit
  210. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  211. :FREESPACE
  212.         Drives=DiskScan(2)     ; 2 is the code for local hard drives
  213.         Dmax=strlen(Drives)
  214.         DIndex=1
  215.         TotalSize=0
  216.         DriveReport=""
  217.  
  218.         :COUNTSPACE
  219.         NextDrive=StrSub(Drives,Dindex,1)
  220.         a=DiskFree(NextDrive)/1024
  221.         TotalSize=a+TotalSize
  222.         DriveReport=strcat(DriveReport,NextDrive," = ",TAB,a,"K",TAB,strfill("|",(a+500)/1000),"@")
  223.         DIndex=Dindex+3  ;each entry is 3 bytes long
  224.         if DIndex<=Dmax then goto COUNTSPACE
  225.         ItemSelect("Total Space Available = %TotalSize%K",DriveReport,"@")
  226.         Drop(TotalSize,DriveReport,Drives,NextDrive)
  227.         Exit
  228. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  229. :FILEINFO
  230.         CancelCmd="goto cancelfi"
  231.         a=FileItemize("")
  232.         if a=="" then a=FileItemize("*.*")
  233.         tot=FileSize(a)
  234.         c=ItemCount(a," ")
  235.         n=0
  236.         b=""
  237.         :ffloop
  238.         if n==c then goto ffshow
  239.         n=n+1
  240.         a1=StrFix(ItemExtract(n,a," ")," ",14)
  241.         a2=FileSize(a1)
  242.         a3=FileTimeGet(a1)
  243.         a4=FileAttrGet(a1)
  244.         b=strcat(b,a1,tab,a2,tab,a3,tab,a4,"|")
  245.         goto ffloop
  246.         :ffshow
  247.         ItemSelect("Total Size=%tot%",b,"|")
  248.         :cancelfi
  249.         drop(a,tot,c,n,a1,a2,a3,a4,b)
  250.         Exit
  251. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  252. :DIRSIZE
  253.         tot = FileSize(FileItemize(""))
  254.         sub1 = DirItemize("")
  255.         if (tot==0 && sub1=="") then tot=FileSize(FileItemize("*.*"))
  256.                                 then sub1=DirItemize("*.*")
  257.         totdir=0
  258.         level=1
  259.         dir1=DirGet()
  260.         numdir1 = ItemCount(sub1, " ")
  261.         index1 = 0
  262.   
  263.         :dsloop
  264.         If index%level% == numdir%level% Then Goto upalevel
  265.         index%level% = index%level% + 1
  266.         DirChange(StrCat(dir%level%, ItemExtract(index%level%, sub%level%, " ")))
  267.         totdir=totdir+1
  268.         tot = tot + FileSize(FileItemize("*.*"))
  269.         level = level + 1
  270.         dir%level% = DirGet()
  271.         sub%level% = DirItemize("*.*")
  272.         numdir%level% = ItemCount(sub%level%, " ")
  273.         index%level% = 0
  274.         goto dsloop
  275.   
  276.         :upalevel
  277.         drop(dir%level%,sub%level%,index%level%,numdir%level%)
  278.         level=level-1
  279.         if level!=0 then goto dsloop
  280.  
  281.         ; -----------
  282.         ; Termination
  283.         ; -----------
  284.         If StrLen(tot) < 9 Then tot = StrCat(StrFill("", 9 - StrLen(tot)), tot)
  285.         tot = StrCat(StrSub(tot,1,3),",",StrSub(tot,4,3),",",StrSub(tot,7,3))
  286.         tot = StrTrim(tot)
  287.         If StrSub(tot, 1, 1) == "," Then tot = StrSub(tot, 2, StrLen(tot) - 1)
  288.         tot = StrTrim(tot)
  289.         If StrSub(tot, 1, 1) == "," Then tot = StrSub(tot, 2, StrLen(tot) - 1)
  290.         tot = StrTrim(tot)
  291.         Message("%totdir% Subdirectories included", "Total size %tot% bytes.")
  292.         drop(tot,level,totdir)
  293.         Exit
  294.  
  295. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  296. :FONEBOOK
  297.         ; This code implements a phone dialer with WIL language statements.
  298.         ; The phone numbers are kept in the FONEBOOK.TXT file.  It is simply a text
  299.         ; file with name followed by number.  This code assumes everything after the
  300.         ; last space is part of the phone number.
  301.  
  302.         ; The code also assumes that the COM port has been correctly set up in the
  303.         ; PORTS section of the control panel.  Mostly be sure the Control Panel
  304.         ; ports section has the right baud rate for your modem in it.
  305.  
  306.         ; User initialization section.  Set these to correspond to your modem commands.
  307.         ; Most users will only have to check the ComPort setting.
  308.  
  309.         CancelCmd="goto CancelFB"
  310.         FBCancelCmd="Exit"
  311.         ComPort=IniReadPvt("FileCmdr","PhonePort","ASK","WWW-PROD.INI")
  312.         OldFont=99
  313.         XPort=ComPort
  314.         if ComPort=="ASK" then XPort=AskLine("Phone Book","Enter modem COM port.%CR%If you have problems dialing, verify%CR%COM port setting in Windows Control Panel","COM1")
  315.         if XPort=="" then exit
  316.         if XPort!=ComPort then IniWritePvt("FileCmdr","PhonePort",Xport,"WWW-PROD.INI")
  317.                           then ComPort=XPort
  318.  
  319.         DialPrefix="ATDT"
  320.         HangCommand="ATH0"
  321.  
  322.         ; And here we go.  First make a CR/LF and a TAB
  323.         CR=strcat(num2char(13),num2char(10))
  324.         TAB=num2char(9)
  325.  
  326.         ; Use Home Directory
  327.         DirChange(DirHome())
  328.         ; Make sure there is a fonebook.txt file
  329.         if !FileExist("FONEBOOK.TXT") then fp=FileOpen("FONEBOOK.TXT","WRITE")
  330.                                       then FileWrite(fp,"Emergency Services      911")
  331.                                       then FileWrite(fp,"Directory Assistance    1-555-1212")
  332.                                       then FileClose(fp)
  333.  
  334.  
  335.         ; Put up the TextBox so the user can choose a number
  336.         :NewNum
  337.         FBCancelCmd="Exit"                   ; What to do if user hits "Cancel"
  338.         OldFont=IntControl(28,1,0,0,0)     ;Select fixed pitch font for textbox
  339.         num=StrTrim(TextBoxSort("DIALER - Just hit OK to add a new number","fonebook.txt"))
  340.         IntControl(28,OldFont,0,0,0)
  341.         if num!="" then goto zorkle
  342.  
  343.  
  344.  
  345.         num=strtrim(AskLine("DIALER","Enter name and number as in%CR%(Don't put any spaces in the number)","Joe Blough  1-555-1212"))
  346.         Terminate(num=="","","")
  347.         a=StrIndex(num," ",0,@BACKSCAN)
  348.         num2=strsub(num,a+1,strlen(num)-a)
  349.         num=strtrim(strsub(num,1,a-1))
  350.         num=strcat(strfix(num,' ',25),num2)
  351.         fp=FileOpen("temp876.num","WRITE")
  352.         FileWrite(fp,num)       ; send it the number to dial
  353.         FileClose(fp)
  354.         FileAppend("temp876.num","fonebook.txt")
  355.         FileDelete("temp876.num")
  356.         goto newnum
  357.  
  358.         :zorkle
  359.         a=StrIndex(num," ",0,@BACKSCAN)
  360.         b=Strindex(num,TAB,0,@BACKSCAN)
  361.         a=max(a,b)
  362.         num=strsub(num,a+1,strlen(num)-a)
  363.         DialCommand="%DialPrefix%%NUM%;"
  364.  
  365.  
  366.         :redial
  367.         fp=FileOpen(ComPort,"WRITE")
  368.         FileWrite(fp,"ATZ")        ; Send a CR to wake modem up
  369.         Delay(2)                   ; Let it get out of bed.
  370.         FileWrite(fp,DialCommand)
  371.         FileClose(fp)
  372.         Delay(3)                   ; Give modem a chance to think
  373.  
  374.         FBCancelCmd="Goto Hang1"
  375.         a=AskYesNo("Dialer","Yes=HANGUP%CR%No=REDIAL%CR%Cancel=New Number")
  376.  
  377.         fp=FileOpen(ComPort,"WRITE")
  378.         FileWrite(fp,HangCommand)
  379.         FileClose(fp)
  380.  
  381.         if a==@YES then exit
  382.         Display(30,"Dialer","Redial Wait")
  383.         goto redial
  384.  
  385.         :CANCELFB
  386.         if OldFont!=99 then IntControl(28,OldFont,0,0,0)
  387.         %FBCancelCmd%
  388.  
  389.         :Hang1
  390.         fp=FileOpen(ComPort,"WRITE")
  391.         FileWrite(fp,HangCommand)
  392.         FileClose(fp)
  393.         goto NewNum
  394. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  395. :INIEDIT
  396.         DirChange(DirWindows(0))
  397.         CancelCmd="goto BYEBYE"
  398.         IniFiles=""
  399.         bSys386=0
  400.  
  401.         :UP1
  402.         CancelCmd="goto byebye"
  403.         If IniFiles!="" then goto inied
  404.         IniFiles=FileItemize("*.INI")
  405.         :inied
  406.         ButtonNames("&Edit File","&Quit")
  407.         TheFile=ItemSelect("Choose Desired INI file",IniFiles," ")
  408.         if TheFile=="" then goto newini
  409.         Sections=""
  410.  
  411.         :UP2
  412.         CancelCmd="goto up1"
  413.         if Sections!="" then goto sected
  414.         Sections=IniItemizePvt("",TheFile)
  415.         :SECTED
  416.         ButtonNames("&Edit Section","&Up a Level")
  417.         Section=ItemSelect("%TheFile% - Choose Section",Sections,TAB)
  418.         if Section=="" then goto AddSect
  419.         if stricmp(Section,"386Enh")==0 then bSys386=1
  420.                                         else bSys386=0
  421.         KeyValues=""
  422.  
  423.         :UP3
  424.         CancelCmd="goto up2"
  425.         if KeyValues!="" then goto looped
  426.         Keys=IniItemizePvt(Section,TheFile)
  427.         if (bSys386) then Keys=StrReplace(Keys,"device%TAB%","")
  428.                      then Keys=StrReplace(Keys,"Device%TAB%","")
  429.                      then Keys=StrReplace(Keys,"DEVICE%TAB%","")
  430.                      then Keys=StrReplace(Keys,"device","")
  431.                      then Keys=StrReplace(Keys,"Device","")
  432.                      then Keys=StrReplace(Keys,"DEVICE","")
  433.         KeyMax=ItemCount(Keys,TAB)
  434.         KeyIndex=0
  435.  
  436.         :ieLoop
  437.         if KeyIndex==KeyMax then goto looped
  438.         KeyIndex=KeyIndex+1
  439.         ThisKey=ItemExtract(KeyIndex,Keys,TAB)
  440.         ThisValue=IniReadPvt(Section,ThisKey,"???",TheFile)
  441.         KeyValues=strcat(KeyValues,ThisKey,"= ",ThisValue,TAB)
  442.         goto ieLoop
  443.  
  444.         :looped
  445.         ButtonNames("&Edit KeyWord","&Up a Level")
  446.         Key=ItemSelect("%TheFile% [%Section%] - Choose Keyword",KeyValues,TAB)
  447.         if Key=="" then goto AddKey
  448.         Key=ItemExtract(1,Key,"=")
  449.  
  450.         Value=IniReadPvt(Section,Key,"???",TheFile)
  451.         goto entkey
  452.  
  453.  
  454.         :newini
  455.         CancelCmd="goto UP1"
  456.         TheFile=Askline("Making NEW INI file","Enter new INI file name","*.INI")
  457.         if (TheFile=="*.INI" || TheFile=="") then goto newini
  458.         IniFiles=""
  459.         goto AddSectNewIni
  460.  
  461.         :AddSect
  462.         CancelCmd="goto up2"
  463.         :AddSectNewIni
  464.         Section=AskLine("Add New Section to INI File","Enter new section name for%CR%   %TheFile%%CR%      [?????]","")
  465.         Sections=""
  466.         goto AddKeyNewSect
  467.  
  468.         :AddKey
  469.         CancelCmd="goto up3"
  470.         :AddKeyNewSect
  471.         Key=AskLine("Add New Keyword to INI File","Enter new key name for%CR%   %TheFile%%CR%      [%Section%]","")
  472.         if (bSys386 && stricmp(Key,"device"==0)) then Message("Error","Cannot modify or add DEVICE= lines to [386Enh]%CR%with this utility")
  473.                                                  then goto AddKeyNewSect
  474.         Value="(Undefined)"
  475.         KeyValues=""
  476.         goto EntKeyNewKey
  477.  
  478.         :ENTKEY
  479.         CancelCmd="goto up3"
  480.         :EntKeyNewkey
  481.         NewValue=AskLine("Modify INI File Keyword","%TheFile%%CR%   [%Section%]%CR%      %Key% = %Value%",Value)
  482.         if NewValue!=Value then iniwritepvt(Section,Key,NewValue,TheFile)
  483.         KeyValues=""
  484.         goto up3
  485.  
  486.  
  487.         :BYEBYE
  488.         exit
  489. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  490. :SYSINFO
  491.        wintype="retail"
  492.        if WinMetrics(22) then wintype="debug"
  493.  
  494.         wc=WinConfig()
  495.         if !(wc&1) then mode="Real"
  496.         if wc&16 then mode="Standard"
  497.         if wc&32 then mode="Enhanced"
  498.  
  499.         if wc&2 then cpu=286
  500.         if wc&4 then cpu=386
  501.         if wc&8 then cpu=486
  502.         if wc&64 then cpu=8086
  503.         if wc&128 then cpu=80186
  504.  
  505.         Sysinfo=strcat(cpu,' ',mode,' ',wintype,' Windows ',WinVersion(1),'.',WinVersion(0),CR)
  506.  
  507.         math="No math"
  508.         if wc&1024 then math="Math"
  509.         mouse="No Mouse"
  510.         if WinMetrics(19) then mouse="Mouse"
  511.  
  512.         Sysinfo=strcat(sysinfo,math," co-processor.   ",mouse,' available.',CR)
  513.  
  514.         sysinfo=strcat(sysinfo,WinMetrics(0),'x',WinMetrics(1)," video resolution.  ",WinMetrics(-1),"  colors.",CR)
  515.  
  516.         ErrorMode(@OFF)
  517.         LastError()
  518.         PlayMedia("Status WaveForm Ready")
  519.         ErrorMode(@CANCEL)
  520.         if LastError()!=1193 then sysinfo=strcat(sysinfo,"Windows multimedia extensions present.",CR)
  521.  
  522.         bug=NetGetCaps(2)
  523.         if bug==0 then math="No n"
  524.         if bug!=0 then math="N"
  525.         if bug==256 then math="Microsoft n"
  526.         if bug==512 then math="Lan Manager n"
  527.         if bug==768 then math="Novell NetWare n"
  528.         if bug==1024 then math="Banyan Vines n"
  529.         if bug==1280 then math="10 Net n"
  530.         sysinfo=strcat(sysinfo,math,"etwork installed.",CR)
  531.  
  532.         bug=WinResources(0)/1024   ; Compute memory avail
  533.         math=strlen(bug)
  534.         if math>3 then bug=strcat(strsub(bug,1,math-3),',',strsub(bug,math-2,3))
  535.  
  536.         sysinfo=strcat(sysinfo,CR,bug," KB Free Memory",CR)
  537.         sysinfo=strcat(sysinfo,WinResources(2),"%% System Resources Free (",WinResources(3),"%% GDI, ",WinResources(4),"%% User)",CR)
  538.  
  539.         sysinfo=strcat(sysinfo,"DOS ",DosVersion(1),'.',DosVersion(0),"  using ",environment("COMSPEC"),CR)
  540.         disks=DiskScan(1)
  541.         if disks!="" then sysinfo=strcat(sysinfo,"Floppies ",disks,CR)
  542.         disks=DiskScan(2)
  543.         if disks!="" then sysinfo=strcat(sysinfo,"Hard Disks ",disks,CR)
  544.         disks=DiskScan(4)
  545.         if disks!="" then sysinfo=strcat(sysinfo,"Network Disks ",disks,CR)
  546.         sysinfo=strcat(sysinfo,"Windows Directory ",DirWindows(0),CR)
  547.         sysinfo=strcat(sysinfo,"System  Directory ",DirWindows(1),CR)
  548.         sysinfo=strcat(sysinfo,CR,"WIL Interpreter Ver ",VersionDll())
  549.  
  550.         ver=Version()
  551.         Message("%Param2% %ver% SysInfo",Sysinfo)
  552.         Exit
  553.  
  554. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  555. :ZIP
  556. :UNZIP
  557.     CancelCommand="goto ZZCANCEL"
  558.     ErrMsg=""
  559.     If !FileExist("wwwdos.bat")   Then ErrMsg="WWWDOS.BAT   not found"
  560.     If !FileExist("wwwdosp.pif")  Then ErrMsg="WWWDOSP.PIF  not found"
  561.     If !FileExist("wwwdosc.pif")  Then ErrMsg="WWWDOSC.PIF  not found"
  562.     If !FileExist("wwwzipls.exe") Then ErrMsg="WWWZIPLS.EXE not found"
  563.     If !FileExist("pkzip.exe")    Then ErrMsg="PKZIP.EXE    not found"
  564.     If !FileExist("pkunzip.exe")  Then ErrMsg="PKUNZIP.EXE  not found"
  565.     If !FileExist("browser.exe")  Then ErrMsg="BROWSER.EXE  not found"
  566.     If ErrMsg!="" Then Goto ShowError
  567.  
  568.         goto %param1%2     ; must be ZIP or UNZIP
  569.  
  570. :ZIP2
  571.         DaMove=" -a "
  572.         DaDirs=""
  573.         DaWho="*.*"
  574.         DaZip=""
  575.         DaRefresh=0
  576.         DaTitle="Files"
  577.         param3=strlower(param3)
  578.         if param3=="move" then DaMove=" -m "
  579.         goto %param2%         ; Must be CURRENT, DIR, SUBDIR, or HILITED
  580.  
  581. :CURRENT
  582.         DaWho=strcat(CurrentPath(),CurrentFile())
  583.         DaZip=strcat(FileRoot(DaWho),".ZIP")
  584.         goto ZIPDO
  585. :SUBDIR
  586.        DaDirs=" -r -p "
  587.        DaRefresh=1
  588.        DaTitle="Structure"
  589.        goto ZIPDO
  590.  
  591. :HILITED
  592.         b=FileItemize("")
  593.         If b=="" Then ErrMsg="Zip Hilited files?  No files hilited!"
  594.                  Then Goto ShowError
  595.         b=strreplace(b," ",CR)
  596.         fp=FileOpen("FC-TEMP9.XCV","WRITE")
  597.         FileWrite(fp,b)
  598.         FileClose(fp)
  599.         Drop(b)
  600.         DaWho="@FC-TEMP9.XCV"
  601.         goto ZIPDO
  602.  
  603. :DIR
  604.        DaTitle="Directory"
  605.        goto ZIPDO
  606.  
  607. :ZIPDO
  608.         DaZip=AskLine("Zip %DaTitle%","Enter desired ZIP name",DaZip)
  609.         if DaZip=="" then goto zzcancel
  610.         Runwait("wwwdosc.pif","pkzip.exe %DaMove% %DaDirs% %DaZip% %DaWho%")
  611.         if DaWho=="FC-TEMP9.XCV" then FileDelete(DaWho)
  612.         Refresh(DaRefresh)
  613.         Display(3,"Zip %DaTitle%","Complete")
  614.         goto zzcancel
  615.  
  616. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  617. :UNZIP2
  618.  
  619.        ViewFlag=0
  620.        zipsort=param3
  621.        goto %param2%    ; must be ALL, VIEW, or INDIV
  622.  
  623. :ALL
  624.         zipfile=strcat(CurrentPath(),CurrentFile())
  625.         if FileExtension(zipfile)=="ZIP" then goto alldoit
  626.         zipfile=FileItemize("*.zip")
  627.         If zipfile=="" Then ErrMsg="UnZip files?  No zip files found!"
  628.                  Then Goto ShowError
  629.         zipfile=itemselect("Select file to UnZip",zipfile," ")
  630.         if zipfile=="" then goto zzcancel
  631. :alldoit
  632.         if param3==2 then goto allspec
  633.         runwait("wwwdosc.pif","pkunzip.exe -d %zipfile%")
  634.         Refresh(1)
  635.         goto zzcancel
  636.  
  637. :allspec
  638.         RetHome="allspec1"
  639.         goto DoOptions
  640. :allspec1
  641.         if overwarn==0 then overwarn=" -o "
  642.                        else overwarn=""
  643.         RunWait("wwwdosc.pif", "pkunzip.exe -d %overwarn% %zipfile% %targdir% *.*")
  644.         Refresh(1)
  645.         goto zzcancel
  646.  
  647.  
  648.  
  649. :INDIV
  650.        ViewFlag=param3
  651.        if ViewFlag==1 then zipsort=1
  652.                       then overwarn=0
  653.                       then targdir=""
  654.                       then goto VIEW
  655.  
  656.         RetHome="VIEW"
  657.         goto DoOptions
  658.  
  659. :VIEW
  660.         workdir = Environment("TEMP")
  661.         If workdir == "" Then workdir = DirWindows(0)
  662.         If StrSub(workdir, StrLen(workdir), 1) != "\" Then workdir = StrCat(workdir, "\")
  663.         if ViewFlag==0 then targdir=workdir
  664.         zipfile=strcat(CurrentPath(),CurrentFile())
  665.         if FileExtension(zipfile)=="ZIP" then goto viewdoit
  666.         zipfile=FileItemize("*.zip")
  667.         If zipfile=="" Then ErrMsg="UnZip files?  No zip files found!"
  668.                  Then Goto ShowError
  669.         if ViewFlag==0 then TSMsg="Select ZIP file to view"
  670.                        else TSMsg="Select ZIP file to use"
  671.         zipfile=itemselect(TSMsg,zipfile," ")
  672.         if zipfile=="" then goto zzcancel
  673.  
  674. :viewdoit
  675.         ziplist = StrCat(workdir, "wwwunzip.lst")
  676.         If FileExist(ziplist) Then FileDelete(ziplist)
  677.  
  678.         RunWait("wwwzipls.exe","%zipfile% %ziplist% %zipsort%")
  679.         if ViewFlag==0 then TSMsg="Select file to view"
  680.                        else TSMsg="Select file to extract"
  681. :TXSEL
  682.         OldFont=IntControl(28,1,0,0,0)        ; Set fixed pitch font in text box
  683.         member=TextBox(TSMsg,ziplist)
  684.         IntControl(28,OldFont,0,0,0)          ; Restore previous font pitch type
  685.         if member=="" then goto ZZCANCEL
  686.  
  687.         member=strsub(member,46,strlen(member)-45)
  688.         memfile=FileExtension(member)
  689.         if memfile!="" then memfile=strcat(FileRoot(member),".",memfile)
  690.                        else memfile=FileRoot(member)
  691.         
  692.  
  693.         if ViewFlag==0 then goto extract
  694.         if overwarn==0 then goto extract
  695.         If FileExist("%targdir%%memfile%") == @FALSE Then Goto extract
  696.         b= AskYesNo("%member% already exists in %targdir%", "Do you wish to replace it?")
  697.         If b == @NO Then Goto TXSEL
  698.  
  699. :extract
  700.         RunHideWait("wwwdosc.pif", "pkunzip.exe -o %zipfile% %targdir% %member%")
  701.         If !FileExist("%targdir%%memfile%") Then ErrMsg="Problem extracting %member% from ZIP file"
  702.                                            Then Goto ShowError
  703.  
  704.         if ViewFlag!=0 then TSMsg="Extract Another?"
  705.                        then goto TXSEL
  706.         member = StrUpper(StrCat(targdir, memfile))
  707.         RunZoomWait("browser.exe", member)
  708.         FileDelete(member)
  709.         TSMsg="View Another?"
  710.         goto TXSEL
  711.  
  712.  
  713. :SHOWERROR
  714.     Message("Error", ErrMsg)
  715.  
  716. :ZZCANCEL
  717.     if IsDefined(ziplist) then If FileExist(ziplist) Then FileDelete(ziplist)
  718.     Drop(DaMove,DaDirs,DaWho,DaZip,DaRefresh,DaTitle,ViewFlag,zipsort)
  719.     Drop(zipfile,b,RetHome,overwarn,targdir,workdir,ziplist,TSMsg,member)
  720.     Drop(ErrMsg,usecurdir,ThisDir,CheckDir,memfile)
  721.     Drop(ZippyFormat,ZippyCaption,ZippyX,ZippyY,ZippyWidth,ZippyHeight)
  722.     Drop(ZippyNumControls,Zippy01,Zippy02,Zippy03,Zippy04,Zippy05,Zippy06)
  723.     Drop(Zippy07,Zippy08,Zippy09,Zippy10,Zippy11,Zippy12,Zippy13)
  724.     exit
  725. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  726.  
  727. :DOOPTIONS
  728.         zipsort = IniReadPvt("WWWUNZIP", "SortOrder", 1, "www-prod.ini")
  729.         overwarn=IniReadPvt("WWWUNZIP","OverWarn",1,"www-prod.ini")
  730.         whichdir=IniReadPvt("WWWUNZIP","WhichDir",1,"www-prod.ini")
  731.  
  732.         ; Undocumented, new, beta dialog function being used here.  Will
  733.         ; be documented in the 2.0 release.  Good Luck.
  734.  
  735.  
  736.         ZippyFormat=`WWWDLGED,4.0`
  737.  
  738.         ZippyCaption=`Zip Options`
  739.     ZippyX=69
  740.     ZippyY=85
  741.     ZippyWidth=217
  742.     ZippyHeight=115
  743.     ZippyNumControls=13
  744.     Zippy01=`6,18,80,DEFAULT,RADIOBUTTON,whichdir,"Use Current Dir ->",1`
  745.     Zippy02=`6,32,80,DEFAULT,RADIOBUTTON,whichdir,"Use Specified Dir ->",2`
  746.     Zippy03=`86,32,124,DEFAULT,EDITBOX,targdir,""`
  747.     Zippy04=`16,64,56,DEFAULT,RADIOBUTTON,zipsort,"by Name",1`
  748.     Zippy05=`16,76,58,DEFAULT,RADIOBUTTON,zipsort,"by Extension",2`
  749.     Zippy06=`16,88,46,DEFAULT,RADIOBUTTON,zipsort,"by Date",3`
  750.     Zippy07=`16,100,46,DEFAULT,RADIOBUTTON,zipsort,"by Size",4`
  751.     Zippy08=`108,58,80,DEFAULT,CHECKBOX,overwarn,"Warn on Overwrite",1`
  752.  
  753.     Zippy09=`120,78,64,DEFAULT,PUSHBUTTON,DEFAULT,"&Ok",1`
  754.     Zippy10=`120,98,64,DEFAULT,PUSHBUTTON,DEFAULT,"&Cancel",0`
  755.     Zippy11=`6,4,64,DEFAULT,STATICTEXT,NONAME,"Target Directory"`
  756.     Zippy12=`6,52,64,DEFAULT,STATICTEXT,NONAME,"Sort list by:"`
  757.     Zippy13=`88,20,122,DEFAULT,VARYTEXT,ThisDir,""`
  758.  
  759.  
  760. :gettarg
  761.         ; Undocumented, new, beta dialog function being used here.  Will
  762.         ; be documented in the 2.0 release.  Good Luck.
  763.         ThisDir=DirGet()
  764.         targdir = IniReadPvt("WWWUNZIP", "TargetDir", DirGet(), "www-prod.ini")
  765.         Dialog("Zippy")
  766.  
  767.         if whichdir==1 then usecurdir = @YES
  768.                        then targdir=ThisDir
  769.                        else usecurdir = @NO
  770.         targdir = StrUpper(targdir)
  771.         If targdir == "" Then usecurdir = @YES
  772.                          Then targdir = DirGet()
  773.         If StrSub(targdir, StrLen(targdir), 1) != "\" Then targdir = StrCat(targdir, "\")
  774.         If ThisDir==targdir then usecurdir = @YES
  775.                             then goto targok
  776.         DirChange(targdir)
  777.         CheckDir=DirGet()
  778.         DirChange(ThisDir)
  779.         If ThisDir!=CheckDir Then Goto targok
  780.  
  781.         b= AskYesNo("WWWUNZIP", "%targdir% does not exist.  Do you wish to create it?")
  782.         If b == @NO Then Goto gettarg
  783.         DirMake(targdir)
  784.         DirChange(targdir)
  785.         CheckDir=DirGet()
  786.         DirChange(ThisDir)
  787.         If ThisDir!=CheckDir Then Goto targok
  788.         Message("WWWUNZIP","%targdir% could not be created.  Please respecify.")
  789.         goto gettarg
  790.  
  791.         :targok
  792.         If usecurdir == @NO Then IniWritePvt("WWWUNZIP", "TargetDir", targdir, "www-prod.ini")
  793.         IniWritePvt("WWWUNZIP", "SortOrder", zipsort, "www-prod.ini")
  794.         IniWritePvt("WWWUNZIP", "OverWarn", overwarn, "www-prod.ini")
  795.         IniWritePvt("WWWUNZIP", "WhichDir", whichdir, "www-prod.ini")
  796.         goto %RetHome%
  797. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  798. :CANCEL        ; This cancel is shared by ALL the above routines.
  799. %CancelCmd%    ; Execute Cancel Command
  800.